package com.itheima.health.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.itheima.health.mapper.MemberMapper;
import com.itheima.health.pojo.Member;
import com.itheima.health.service.MemberService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> implements MemberService {


    @Override
    public Member findMemberByTelephone(String telephone) {

        return baseMapper.findMemberByTelephone(telephone);
    }

    @Override
    public Member findMemberNameByMemberId(Integer memberId) {
        return baseMapper.findMemberNameByMemberId(memberId);
    }

    @Override
    @LcnTransaction
    public Integer saveMenber(Member member) {
        baseMapper.insert(member);
        return member.getId();
    }


    //报表数据  todoby dzf
    @Override
    public Integer getWeekNumber() {
        return baseMapper.getWeekNumber();
    }

    @Override
    public Integer getDayNumber() {
        return baseMapper.getDayNumber();
    }

    @Override
    public Integer totalMember() {
        return baseMapper.totalMember();
    }

    @Override
    public Integer getMonthNumber() {
        return baseMapper.getMonthNumber();
    }
}
